home *** CD-ROM | disk | FTP | other *** search
- /************************************************/
- /* Sample DLL's */
- /* Copyright © Vincent Parsons 1989. */
- /************************************************/
- /* DLL code for MPW C 3.0 or THINK C 4.0 */
- /* with Excel for the Macintosh 2.2 */
- /* and Microsoft C 5.1 */
- /* with Excel for Windows 2.1 */
- /************************************************/
- /* SampDD is an example of one data type D */
- /* input and one data type D output. The */
- /* output has all upper case letters converted */
- /* to lower case and vice versa. The answer */
- /* has been stored in the Excel buffer used by */
- /* the input variable. */
- /************************************************/
- /* =REGISTER("SampDLLs","SampDD","DD") */
- /* for both the Mac and the PC. */
- /************************************************/
-
- #include "DLL.h"
-
- #if applec
- #include <Types.h>
-
- #elif MSDOS
- #include <windows.h>
-
- #endif
-
- #if THINK_C
- pascal char * main(char * c1); /* prototype */
-
- pascal char * main(c1)
- char * c1;
-
- #elif applec
- pascal char * SampDD(char * c1)
-
- #elif MSDOS
- char far * far pascal SampDD(char far * c1)
- #endif
- {
- short i = 1;
-
- while ( i <= c1[0] ) { /* P String */
- if ((c1[i] >= 'A') && (c1[i] <= 'Z'))
- c1[i] += 32;
- else if ((c1[i] >= 'a') && (c1[i] <= 'z'))
- c1[i] -= 32;
- i++;
- }
-
- return (c1);
- }
-
- /************************************************/
-